package com.authine.cloudpivot.ext.enums.order;

/**
 * @author 张天赐
 */
public enum OrderTypeEnum {
    /**
     * 订单类型
     */
    PurchaseOrder("平台订单"),
    ClientOrder("外部订单"),
    ShopOrder("商城订单"),
    ContractOrder("代购订单"),
    VmiOrder("VMI订单"),
    ;

    public String des;

    OrderTypeEnum(String des) {
        this.des = des;
    }

    public static OrderTypeEnum switchNew(Integer type) {
        if (type.equals(0) || type.equals(3) || type.equals(4)) {
            return OrderTypeEnum.PurchaseOrder;
        }

        if (type.equals(1)) {
            return OrderTypeEnum.ClientOrder;
        }

        if (type.equals(2)) {
            return OrderTypeEnum.ShopOrder;
        }

        if (type.equals(3)) {
            return OrderTypeEnum.ShopOrder;
        }

        return null;
    }
}
